import React from 'react';
import { StyleSheet, View, Platform } from 'react-native';
import { NewsList, Label } from 'iftide';

export default class Basic extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            items: [
                {
                    text: '指数先扬后抑，基金仓位小幅上升指数先扬后抑，基金仓位小幅上升指数先扬后抑，基金仓位小幅上升',
                    badge: '股市',
                    desc: '30分钟前',
                    image: require('./image/pic1.png'),
                    onPress: () => this.onPress()
                },
                {
                    text: '去年有50万，理财一年后剩下5万，为何不来定期理财看看？',
                    badge: '基金理财',
                    badgeContainerStyle: {backgroundColor: '#9bc9ad'},
                    badgeTextColor: '#fff',
                    desc: '1小时前',
                    image: require('./image/pic2.png')
                },
                {
                    text: '均摊成本，平抑风险',
                    desc: '1小时30分钟',
                    badge: '理财',
                    badgeContainerStyle: {backgroundColor: '#f19e9a'},
                    badgeTextColor: '#ff7b7b',
                    image: require('./image/pic3.png')
                },
                {
                    text: '均摊成本，平抑风险，解密定投之道均摊成本平抑风险，解密定投之道',
                    desc: '1小时30分钟',
                    descStyle: {fontFamily: Platform .OS === 'ios' ? 'System' : 'Roboto'}
                    //image: require('./image/pic3.png')
                },
            ]
        };
    }

    onPress = () => {
        alert(1)
    };

    render() {
        return (
            <View style={styles.container}>
                <NewsList
                    list={this.state.items}
                    imageRight={true}
                />
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        height: '100%',
        flex:1
    },
    label: {
        padding: 13,
        backgroundColor: '#F5F7F9',
    },
});